<?php get_header();?>
<?php get_sidebar();?>

<div id="primary">
  <p>
    <?php //dp_recent_comments(3);?>
  </p>
  <?php if(function_exists('breadcrumbs')) breadcrumbs(); ?>
  <div class="post-nav"> <span class="previous floatleft">
    <?php previous_posts_link('Previous posts');?>
    </span> <span class="next floatright">
    <?php next_posts_link('Next posts');?>
    </span> </div>
  <!--End .post-nav-->
  <?php include(TEMPLATEPATH.'/feature.php');?>
  <?php query_posts($query_string.'showposts=8&cat=-8');?>
  <?php if (have_posts()) : while(have_posts()) : the_post(); ?>
  <?php 
			  		/*$args = array(								 
									'post_type'         => 'attachment',									
									'post_mine_type'    => 'image',									
									'numberposts'       =>-1,
									'order' 			=>'ASC',
									'post_status'       => null,
									'post_parent'       => $post->ID
								  );
					$attachments = get_posts($args);  //print_r($attachments);die;	 		
					if($attachments){
						foreach($attachments as $attachment){
							 $thumbnail =  wp_get_attachment_thumb_url($attachment->ID); 
							 break;
						}
					}*/
											
					?>
  
  <div class="post-item" > <a href="<?php the_permalink();?>"><img src="<?php echo get_post_meta($post->ID,'thumbnail',true);?>" alt="post image" width="149" /></a>
    <h1><a href="<?php the_permalink();?>">
      <?php the_title();?>
      </a></h1>
    <p class="metadata"><span class="post">Posted by:</span>
      <?php the_author();?>
      <span class="in-cat">In:</span>
      <?php the_category(', ');?>
      <span class="on-date">On:</span>
      <?php the_time('F j, Y');?>
      <a href="<?php comments_link();?>">
      <?php comments_number('0','1','%');//show number comments?>
      </a> Comments</p>
    <p>
      <?php the_content('');?>
    </p>
    <p><a class="more-link floatright" href="<?php the_permalink();?>">Read More</a></p>
  </div>
  <!--End .post-item -->
  
  <?php endwhile;?>
  <?php else : ?>
  <p> Sorry there are no post to display.</p>
  <?php endif;?>
  <div id="comments-template">
    <?php comments_template(); ?>
  </div>

  
</div>
<!--End #primary-->

<?php get_footer();?>
